using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class AcctHeaderMap : EntityTypeConfiguration<AcctHeader>
    {
        public AcctHeaderMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.HeaderName)
                .HasMaxLength(75);

            this.Property(t => t.FromAcct)
                .HasMaxLength(1000);

            this.Property(t => t.ToAcct)
                .HasMaxLength(40);

            this.Property(t => t.AcctExcept)
                .HasMaxLength(500);

            this.Property(t => t.FromCstctr)
                .HasMaxLength(1000);

            this.Property(t => t.ToCstctr)
                .HasMaxLength(9);

            this.Property(t => t.CstctrExcept)
                .HasMaxLength(500);

            this.Property(t => t.Sub_Section)
                .HasMaxLength(50);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.TotalRevHeader)
                .HasMaxLength(30);

            this.Property(t => t.Header_nb)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("AcctHeaders");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.HeaderName).HasColumnName("HeaderName");
            this.Property(t => t.FromAcct).HasColumnName("FromAcct");
            this.Property(t => t.ToAcct).HasColumnName("ToAcct");
            this.Property(t => t.AcctExcept).HasColumnName("AcctExcept");
            this.Property(t => t.FromCstctr).HasColumnName("FromCstctr");
            this.Property(t => t.ToCstctr).HasColumnName("ToCstctr");
            this.Property(t => t.CstctrExcept).HasColumnName("CstctrExcept");
            this.Property(t => t.FRS_Section).HasColumnName("FRS_Section");
            this.Property(t => t.Sub_Section).HasColumnName("Sub_Section");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.Rep_Type).HasColumnName("Rep_Type");
            this.Property(t => t.Sort_Order).HasColumnName("Sort_Order");
            this.Property(t => t.TotalRevHeader).HasColumnName("TotalRevHeader");
            this.Property(t => t.Exclude_Calc).HasColumnName("Exclude_Calc");
            this.Property(t => t.Sub_Section_Num).HasColumnName("Sub_Section_Num");
            this.Property(t => t.ShowDetail).HasColumnName("ShowDetail");
            this.Property(t => t.Sub_Section_Group).HasColumnName("Sub_Section_Group");
            this.Property(t => t.Level).HasColumnName("Level");
            this.Property(t => t.Header_nb).HasColumnName("Header_nb");
        }
    }
}
